package com.ruoyi.purchase.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName po_brand
 */
@TableName(value ="po_brand")
@Data
public class Brand implements Serializable {
    /**
     * 品牌编号 自增
     */
    @Excel(name = "品牌编号")
    @TableId(type = IdType.AUTO)
    private Integer brandId;

    /**
     * 品牌名称
     */
    @Excel(name = "品牌名称")
    private String brandName;

    /**
     * 商品状态(0:可用；1:不可用)
     */
    @Excel(name = "商品状态",readConverterExp = "1=不可用,0=可用")
    private String status;

    /**7
     * 创建时间
     */
    @Excel(name = "创建时间" ,dateFormat ="yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建人id
     */
    private Integer sysCreateUserId;
    /**
     * 创建人
     */
    @Excel(name="创建人",targetAttr = "userName", type = Excel.Type.EXPORT)
    @TableField(exist = false)
    private SysUser sysUser;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Brand other = (Brand) that;
        return (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getBrandName() == null ? other.getBrandName() == null : this.getBrandName().equals(other.getBrandName()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getSysCreateUserId() == null ? other.getSysCreateUserId() == null : this.getSysCreateUserId().equals(other.getSysCreateUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getBrandName() == null) ? 0 : getBrandName().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getSysCreateUserId() == null) ? 0 : getSysCreateUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", brandId=").append(brandId);
        sb.append(", brandName=").append(brandName);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", sysCreateUserId=").append(sysCreateUserId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}